package com.ruoyi.payTaxes;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.system.domain.payTaxes.PayNashuixinxi;
import com.ruoyi.system.service.IPayNashuixinxiService;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 納稅信息Controller
 * 
 * @author ruoyi
 * @date 2023-04-10
*/
@RestController
@RequestMapping("/nashuixinxi/nashuixinxi")
public class PayNashuixinxiController extends BaseController
{
    @Autowired
    private IPayNashuixinxiService payNashuixinxiService;

    /**
     * 查询納稅信息列表
     */
    @PreAuthorize("@ss.hasPermi('nashuixinxi:nashuixinxi:list')")
    @GetMapping("/list")
    public TableDataInfo list(PayNashuixinxi payNashuixinxi)
    {
        startPage();
        List<PayNashuixinxi> list = payNashuixinxiService.selectPayNashuixinxiList(payNashuixinxi);
        return getDataTable(list);
    }


    /**
     * 获取納稅信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('nashuixinxi:nashuixinxi:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return success(payNashuixinxiService.selectPayNashuixinxiById(id));
    }

    /**
     * 新增納稅信息
     */
    @PreAuthorize("@ss.hasPermi('nashuixinxi:nashuixinxi:add')")
    @Log(title = "納稅信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PayNashuixinxi payNashuixinxi )
    {
        System.out.println(111111);
        System.out.println(payNashuixinxi);
        Integer memberId = payNashuixinxi.getMemberId();
        String content = payNashuixinxi.getContent();
        System.out.println(memberId+"jjjjj"+content);
        return toAjax(payNashuixinxiService.insertPayNashuixinxi(payNashuixinxi));
    }
    /**
     * 新增納稅信息
     */
    /*@RequestMapping("/add")
    public void sendTextMail(String text, Integer m_id){
        payNashuixinxiService.insertPayNashuixinxi(text,m_id);
    }*/

    /**
     * 修改納稅信息
     */
    @PreAuthorize("@ss.hasPermi('nashuixinxi:nashuixinxi:edit')")
    @Log(title = "納稅信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PayNashuixinxi payNashuixinxi)
    {
        return toAjax(payNashuixinxiService.updatePayNashuixinxi(payNashuixinxi));
    }

    /**
     * 删除納稅信息
     */
    @PreAuthorize("@ss.hasPermi('nashuixinxi:nashuixinxi:remove')")
    @Log(title = "納稅信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(payNashuixinxiService.deletePayNashuixinxiByIds(ids));
    }
}
